import Mock from 'mockjs'
// 2.自行模拟数据，开发相关接口
const data = Mock.mock({
  "list|10-30": [{
    "title": '@ctitle',
    "url": '@image(100x100, @color)',
    "desc": '@word(10,20)',
    "id": '@id',
    "mess|2-3": [{
      "name": '@cname',
      "context": '@cword(10,100)',
      "datetime": '@datetime'
    }]
  }],
  "menu|12": [{
    "title": '@ctitle(2)',
    "code": false,
    "id": '@id'
  }]
})


Mock.mock('/api/list', () => {
  return {
    code: 200,
    data: data.list
  }
})


Mock.mock('/api/menu', () => {
  return {
    code: 200,
    data: data.menu
  }
})